Integrand size = 41, antiderivative size = 151 \[ \int (a+i a \tan (e+f x))^3 (A+B \tan (e+f x)) (c-i c \tan (e+f x))^n \, dx=\frac {4 a^3 (i A+B) (c-i c \tan (e+f x))^n}{f n}-\frac {4 a^3 (i A+2 B) (c-i c \tan (e+f x))^{1+n}}{c f (1+n)}+\frac {a^3 (i A+5 B) (c-i c \tan (e+f x))^{2+n}}{c^2 f (2+n)}-\frac {a^3 B (c-i c \tan (e+f x))^{3+n}}{c^3 f (3+n)} \]
4*a^3*(I*A+B)*(c-I*c*tan(f*x+e))^n/f/n-4*a^3*(I*A+2*B)*(c-I*c*tan(f*x+e))^ (1+n)/c/f/(1+n)+a^3*(I*A+5*B)*(c-I*c*tan(f*x+e))^(2+n)/c^2/f/(2+n)-a^3*B*( c-I*c*tan(f*x+e))^(3+n)/c^3/f/(3+n)
Time = 5.19 (sec) , antiderivative size = 154, normalized size of antiderivative = 1.02 \[ \int (a+i a \tan (e+f x))^3 (A+B \tan (e+f x)) (c-i c \tan (e+f x))^n \, dx=-\frac {i a^3 (c-i c \tan (e+f x))^n \left (i B \left (24+9 n+n^2\right )-A \left (24+23 n+8 n^2+n^3\right )-i n \left (2 A (3+n)^2-i B \left (24+9 n+n^2\right )\right ) \tan (e+f x)+n (1+n) (A (3+n)-i B (9+2 n)) \tan ^2(e+f x)+B n \left (2+3 n+n^2\right ) \tan ^3(e+f x)\right )}{f n (1+n) (2+n) (3+n)} \]
((-I)*a^3*(c - I*c*Tan[e + f*x])^n*(I*B*(24 + 9*n + n^2) - A*(24 + 23*n + 8*n^2 + n^3) - I*n*(2*A*(3 + n)^2 - I*B*(24 + 9*n + n^2))*Tan[e + f*x] + n *(1 + n)*(A*(3 + n) - I*B*(9 + 2*n))*Tan[e + f*x]^2 + B*n*(2 + 3*n + n^2)* Tan[e + f*x]^3))/(f*n*(1 + n)*(2 + n)*(3 + n))
Time = 0.39 (sec) , antiderivative size = 138, normalized size of antiderivative = 0.91, number of steps used = 6, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.122, Rules used = {3042, 4071, 27, 86, 2009}
Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.
\(\displaystyle \int (a+i a \tan (e+f x))^3 (A+B \tan (e+f x)) (c-i c \tan (e+f x))^n \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int (a+i a \tan (e+f x))^3 (A+B \tan (e+f x)) (c-i c \tan (e+f x))^ndx\) |
\(\Big \downarrow \) 4071 |
\(\displaystyle \frac {a c \int a^2 (i \tan (e+f x)+1)^2 (A+B \tan (e+f x)) (c-i c \tan (e+f x))^{n-1}d\tan (e+f x)}{f}\) |
\(\Big \downarrow \) 27 |
\(\displaystyle \frac {a^3 c \int (i \tan (e+f x)+1)^2 (A+B \tan (e+f x)) (c-i c \tan (e+f x))^{n-1}d\tan (e+f x)}{f}\) |
\(\Big \downarrow \) 86 |
\(\displaystyle \frac {a^3 c \int \left (4 (A-i B) (c-i c \tan (e+f x))^{n-1}-\frac {4 (A-2 i B) (c-i c \tan (e+f x))^n}{c}+\frac {(A-5 i B) (c-i c \tan (e+f x))^{n+1}}{c^2}+\frac {i B (c-i c \tan (e+f x))^{n+2}}{c^3}\right )d\tan (e+f x)}{f}\) |
\(\Big \downarrow \) 2009 |
\(\displaystyle \frac {a^3 c \left (\frac {(5 B+i A) (c-i c \tan (e+f x))^{n+2}}{c^3 (n+2)}-\frac {4 (2 B+i A) (c-i c \tan (e+f x))^{n+1}}{c^2 (n+1)}+\frac {4 (B+i A) (c-i c \tan (e+f x))^n}{c n}-\frac {B (c-i c \tan (e+f x))^{n+3}}{c^4 (n+3)}\right )}{f}\) |
(a^3*c*((4*(I*A + B)*(c - I*c*Tan[e + f*x])^n)/(c*n) - (4*(I*A + 2*B)*(c - I*c*Tan[e + f*x])^(1 + n))/(c^2*(1 + n)) + ((I*A + 5*B)*(c - I*c*Tan[e + f*x])^(2 + n))/(c^3*(2 + n)) - (B*(c - I*c*Tan[e + f*x])^(3 + n))/(c^4*(3 + n))))/f
3.7.89.3.1 Defintions of rubi rules used
Int[(a_)*(Fx_), x_Symbol] :> Simp[a Int[Fx, x], x] /; FreeQ[a, x] && !Ma tchQ[Fx, (b_)*(Gx_) /; FreeQ[b, x]]
Int[((a_.) + (b_.)*(x_))*((c_) + (d_.)*(x_))^(n_.)*((e_.) + (f_.)*(x_))^(p_ .), x_] :> Int[ExpandIntegrand[(a + b*x)*(c + d*x)^n*(e + f*x)^p, x], x] /; FreeQ[{a, b, c, d, e, f, n}, x] && ((ILtQ[n, 0] && ILtQ[p, 0]) || EqQ[p, 1 ] || (IGtQ[p, 0] && ( !IntegerQ[n] || LeQ[9*p + 5*(n + 2), 0] || GeQ[n + p + 1, 0] || (GeQ[n + p + 2, 0] && RationalQ[a, b, c, d, e, f]))))
Int[((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_.)*((A_.) + (B_.)*tan[(e_.) + (f_.)*(x_)])*((c_) + (d_.)*tan[(e_.) + (f_.)*(x_)])^(n_.), x_Symbol] :> Si mp[a*(c/f) Subst[Int[(a + b*x)^(m - 1)*(c + d*x)^(n - 1)*(A + B*x), x], x , Tan[e + f*x]], x] /; FreeQ[{a, b, c, d, e, f, A, B, m, n}, x] && EqQ[b*c + a*d, 0] && EqQ[a^2 + b^2, 0]
Time = 0.96 (sec) , antiderivative size = 271, normalized size of antiderivative = 1.79
method | result | size |
derivativedivides | \(\frac {i \left (A \,a^{3} n^{3}-i B \,a^{3} n^{2}+8 A \,a^{3} n^{2}-9 i B \,a^{3} n +23 a^{3} A n -24 i B \,a^{3}+24 a^{3} A \right ) {\mathrm e}^{n \ln \left (c -i c \tan \left (f x +e \right )\right )}}{\left (n^{2}+3 n +2\right ) f n \left (3+n \right )}-\frac {a^{3} \left (-i B \,n^{2}+2 A \,n^{2}-9 i B n +12 A n -24 i B +18 A \right ) \tan \left (f x +e \right ) {\mathrm e}^{n \ln \left (c -i c \tan \left (f x +e \right )\right )}}{f \left (n^{2}+3 n +2\right ) \left (3+n \right )}-\frac {\left (i A n +3 i A +2 B n +9 B \right ) a^{3} \tan \left (f x +e \right )^{2} {\mathrm e}^{n \ln \left (c -i c \tan \left (f x +e \right )\right )}}{f \left (3+n \right ) \left (2+n \right )}-\frac {i B \,a^{3} \tan \left (f x +e \right )^{3} {\mathrm e}^{n \ln \left (c -i c \tan \left (f x +e \right )\right )}}{f \left (3+n \right )}\) | \(271\) |
default | \(\frac {i \left (A \,a^{3} n^{3}-i B \,a^{3} n^{2}+8 A \,a^{3} n^{2}-9 i B \,a^{3} n +23 a^{3} A n -24 i B \,a^{3}+24 a^{3} A \right ) {\mathrm e}^{n \ln \left (c -i c \tan \left (f x +e \right )\right )}}{\left (n^{2}+3 n +2\right ) f n \left (3+n \right )}-\frac {a^{3} \left (-i B \,n^{2}+2 A \,n^{2}-9 i B n +12 A n -24 i B +18 A \right ) \tan \left (f x +e \right ) {\mathrm e}^{n \ln \left (c -i c \tan \left (f x +e \right )\right )}}{f \left (n^{2}+3 n +2\right ) \left (3+n \right )}-\frac {\left (i A n +3 i A +2 B n +9 B \right ) a^{3} \tan \left (f x +e \right )^{2} {\mathrm e}^{n \ln \left (c -i c \tan \left (f x +e \right )\right )}}{f \left (3+n \right ) \left (2+n \right )}-\frac {i B \,a^{3} \tan \left (f x +e \right )^{3} {\mathrm e}^{n \ln \left (c -i c \tan \left (f x +e \right )\right )}}{f \left (3+n \right )}\) | \(271\) |
risch | \(\text {Expression too large to display}\) | \(3835\) |
I/(n^2+3*n+2)/f/n*(-9*I*B*a^3*n+23*a^3*A*n-24*I*B*a^3+A*a^3*n^3+8*A*a^3*n^ 2-I*B*a^3*n^2+24*a^3*A)/(3+n)*exp(n*ln(c-I*c*tan(f*x+e)))-a^3*(-I*B*n^2+2* A*n^2-9*I*B*n+12*A*n-24*I*B+18*A)/f/(n^2+3*n+2)/(3+n)*tan(f*x+e)*exp(n*ln( c-I*c*tan(f*x+e)))-(I*A*n+3*I*A+2*B*n+9*B)*a^3/f/(3+n)/(2+n)*tan(f*x+e)^2* exp(n*ln(c-I*c*tan(f*x+e)))-I/f/(3+n)*B*a^3*tan(f*x+e)^3*exp(n*ln(c-I*c*ta n(f*x+e)))
Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 335 vs. \(2 (137) = 274\).
Time = 0.26 (sec) , antiderivative size = 335, normalized size of antiderivative = 2.22 \[ \int (a+i a \tan (e+f x))^3 (A+B \tan (e+f x)) (c-i c \tan (e+f x))^n \, dx=-\frac {4 \, {\left (2 \, {\left (-i \, A + B\right )} a^{3} n + 6 \, {\left (-i \, A - B\right )} a^{3} + {\left ({\left (-i \, A - B\right )} a^{3} n^{3} + 6 \, {\left (-i \, A - B\right )} a^{3} n^{2} + 11 \, {\left (-i \, A - B\right )} a^{3} n + 6 \, {\left (-i \, A - B\right )} a^{3}\right )} e^{\left (6 i \, f x + 6 i \, e\right )} + {\left ({\left (-i \, A + B\right )} a^{3} n^{3} + 2 \, {\left (-4 i \, A + B\right )} a^{3} n^{2} + 3 \, {\left (-7 i \, A - 3 \, B\right )} a^{3} n + 18 \, {\left (-i \, A - B\right )} a^{3}\right )} e^{\left (4 i \, f x + 4 i \, e\right )} + 2 \, {\left ({\left (-i \, A + B\right )} a^{3} n^{2} - 6 i \, A a^{3} n + 9 \, {\left (-i \, A - B\right )} a^{3}\right )} e^{\left (2 i \, f x + 2 i \, e\right )}\right )} \left (\frac {2 \, c}{e^{\left (2 i \, f x + 2 i \, e\right )} + 1}\right )^{n}}{f n^{4} + 6 \, f n^{3} + 11 \, f n^{2} + 6 \, f n + {\left (f n^{4} + 6 \, f n^{3} + 11 \, f n^{2} + 6 \, f n\right )} e^{\left (6 i \, f x + 6 i \, e\right )} + 3 \, {\left (f n^{4} + 6 \, f n^{3} + 11 \, f n^{2} + 6 \, f n\right )} e^{\left (4 i \, f x + 4 i \, e\right )} + 3 \, {\left (f n^{4} + 6 \, f n^{3} + 11 \, f n^{2} + 6 \, f n\right )} e^{\left (2 i \, f x + 2 i \, e\right )}} \]
-4*(2*(-I*A + B)*a^3*n + 6*(-I*A - B)*a^3 + ((-I*A - B)*a^3*n^3 + 6*(-I*A - B)*a^3*n^2 + 11*(-I*A - B)*a^3*n + 6*(-I*A - B)*a^3)*e^(6*I*f*x + 6*I*e) + ((-I*A + B)*a^3*n^3 + 2*(-4*I*A + B)*a^3*n^2 + 3*(-7*I*A - 3*B)*a^3*n + 18*(-I*A - B)*a^3)*e^(4*I*f*x + 4*I*e) + 2*((-I*A + B)*a^3*n^2 - 6*I*A*a^ 3*n + 9*(-I*A - B)*a^3)*e^(2*I*f*x + 2*I*e))*(2*c/(e^(2*I*f*x + 2*I*e) + 1 ))^n/(f*n^4 + 6*f*n^3 + 11*f*n^2 + 6*f*n + (f*n^4 + 6*f*n^3 + 11*f*n^2 + 6 *f*n)*e^(6*I*f*x + 6*I*e) + 3*(f*n^4 + 6*f*n^3 + 11*f*n^2 + 6*f*n)*e^(4*I* f*x + 4*I*e) + 3*(f*n^4 + 6*f*n^3 + 11*f*n^2 + 6*f*n)*e^(2*I*f*x + 2*I*e))
Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 3665 vs. \(2 (122) = 244\).
Time = 3.36 (sec) , antiderivative size = 3665, normalized size of antiderivative = 24.27 \[ \int (a+i a \tan (e+f x))^3 (A+B \tan (e+f x)) (c-i c \tan (e+f x))^n \, dx=\text {Too large to display} \]
Piecewise((x*(A + B*tan(e))*(I*a*tan(e) + a)**3*(-I*c*tan(e) + c)**n, Eq(f , 0)), (6*A*a**3*tan(e + f*x)**2/(6*c**3*f*tan(e + f*x)**3 + 18*I*c**3*f*t an(e + f*x)**2 - 18*c**3*f*tan(e + f*x) - 6*I*c**3*f) - 2*A*a**3/(6*c**3*f *tan(e + f*x)**3 + 18*I*c**3*f*tan(e + f*x)**2 - 18*c**3*f*tan(e + f*x) - 6*I*c**3*f) + 6*I*B*a**3*f*x*tan(e + f*x)**3/(6*c**3*f*tan(e + f*x)**3 + 1 8*I*c**3*f*tan(e + f*x)**2 - 18*c**3*f*tan(e + f*x) - 6*I*c**3*f) - 18*B*a **3*f*x*tan(e + f*x)**2/(6*c**3*f*tan(e + f*x)**3 + 18*I*c**3*f*tan(e + f* x)**2 - 18*c**3*f*tan(e + f*x) - 6*I*c**3*f) - 18*I*B*a**3*f*x*tan(e + f*x )/(6*c**3*f*tan(e + f*x)**3 + 18*I*c**3*f*tan(e + f*x)**2 - 18*c**3*f*tan( e + f*x) - 6*I*c**3*f) + 6*B*a**3*f*x/(6*c**3*f*tan(e + f*x)**3 + 18*I*c** 3*f*tan(e + f*x)**2 - 18*c**3*f*tan(e + f*x) - 6*I*c**3*f) - 3*B*a**3*log( tan(e + f*x)**2 + 1)*tan(e + f*x)**3/(6*c**3*f*tan(e + f*x)**3 + 18*I*c**3 *f*tan(e + f*x)**2 - 18*c**3*f*tan(e + f*x) - 6*I*c**3*f) - 9*I*B*a**3*log (tan(e + f*x)**2 + 1)*tan(e + f*x)**2/(6*c**3*f*tan(e + f*x)**3 + 18*I*c** 3*f*tan(e + f*x)**2 - 18*c**3*f*tan(e + f*x) - 6*I*c**3*f) + 9*B*a**3*log( tan(e + f*x)**2 + 1)*tan(e + f*x)/(6*c**3*f*tan(e + f*x)**3 + 18*I*c**3*f* tan(e + f*x)**2 - 18*c**3*f*tan(e + f*x) - 6*I*c**3*f) + 3*I*B*a**3*log(ta n(e + f*x)**2 + 1)/(6*c**3*f*tan(e + f*x)**3 + 18*I*c**3*f*tan(e + f*x)**2 - 18*c**3*f*tan(e + f*x) - 6*I*c**3*f) - 30*I*B*a**3*tan(e + f*x)**2/(6*c **3*f*tan(e + f*x)**3 + 18*I*c**3*f*tan(e + f*x)**2 - 18*c**3*f*tan(e +...
Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 1056 vs. \(2 (137) = 274\).
Time = 0.58 (sec) , antiderivative size = 1056, normalized size of antiderivative = 6.99 \[ \int (a+i a \tan (e+f x))^3 (A+B \tan (e+f x)) (c-i c \tan (e+f x))^n \, dx=\text {Too large to display} \]
4*(2*((A + I*B)*a^3*c^n*n^2 + 6*A*a^3*c^n*n + 9*(A - I*B)*a^3*c^n)*2^n*cos (-2*f*x + n*arctan2(sin(2*f*x + 2*e), cos(2*f*x + 2*e) + 1) - 2*e) + ((A + I*B)*a^3*c^n*n^3 + 2*(4*A + I*B)*a^3*c^n*n^2 + 3*(7*A - 3*I*B)*a^3*c^n*n + 18*(A - I*B)*a^3*c^n)*2^n*cos(-4*f*x + n*arctan2(sin(2*f*x + 2*e), cos(2 *f*x + 2*e) + 1) - 4*e) + ((A - I*B)*a^3*c^n*n^3 + 6*(A - I*B)*a^3*c^n*n^2 + 11*(A - I*B)*a^3*c^n*n + 6*(A - I*B)*a^3*c^n)*2^n*cos(-6*f*x + n*arctan 2(sin(2*f*x + 2*e), cos(2*f*x + 2*e) + 1) - 6*e) + 2*((A + I*B)*a^3*c^n*n + 3*(A - I*B)*a^3*c^n)*2^n*cos(n*arctan2(sin(2*f*x + 2*e), cos(2*f*x + 2*e ) + 1)) - 2*((I*A - B)*a^3*c^n*n^2 + 6*I*A*a^3*c^n*n + 9*(I*A + B)*a^3*c^n )*2^n*sin(-2*f*x + n*arctan2(sin(2*f*x + 2*e), cos(2*f*x + 2*e) + 1) - 2*e ) - ((I*A - B)*a^3*c^n*n^3 + 2*(4*I*A - B)*a^3*c^n*n^2 + 3*(7*I*A + 3*B)*a ^3*c^n*n + 18*(I*A + B)*a^3*c^n)*2^n*sin(-4*f*x + n*arctan2(sin(2*f*x + 2* e), cos(2*f*x + 2*e) + 1) - 4*e) - ((I*A + B)*a^3*c^n*n^3 + 6*(I*A + B)*a^ 3*c^n*n^2 + 11*(I*A + B)*a^3*c^n*n + 6*(I*A + B)*a^3*c^n)*2^n*sin(-6*f*x + n*arctan2(sin(2*f*x + 2*e), cos(2*f*x + 2*e) + 1) - 6*e) - 2*((I*A - B)*a ^3*c^n*n + 3*(I*A + B)*a^3*c^n)*2^n*sin(n*arctan2(sin(2*f*x + 2*e), cos(2* f*x + 2*e) + 1)))/(((-I*n^4 - 6*I*n^3 - 11*I*n^2 - 6*I*n)*(cos(2*f*x + 2*e )^2 + sin(2*f*x + 2*e)^2 + 2*cos(2*f*x + 2*e) + 1)^(1/2*n)*cos(6*f*x + 6*e ) - 3*(I*n^4 + 6*I*n^3 + 11*I*n^2 + 6*I*n)*(cos(2*f*x + 2*e)^2 + sin(2*f*x + 2*e)^2 + 2*cos(2*f*x + 2*e) + 1)^(1/2*n)*cos(4*f*x + 4*e) + (n^4 + 6...
\[ \int (a+i a \tan (e+f x))^3 (A+B \tan (e+f x)) (c-i c \tan (e+f x))^n \, dx=\int { {\left (B \tan \left (f x + e\right ) + A\right )} {\left (i \, a \tan \left (f x + e\right ) + a\right )}^{3} {\left (-i \, c \tan \left (f x + e\right ) + c\right )}^{n} \,d x } \]
Time = 13.21 (sec) , antiderivative size = 323, normalized size of antiderivative = 2.14 \[ \int (a+i a \tan (e+f x))^3 (A+B \tan (e+f x)) (c-i c \tan (e+f x))^n \, dx=-\frac {{\left (c+\frac {c\,\left ({\mathrm {e}}^{e\,2{}\mathrm {i}+f\,x\,2{}\mathrm {i}}\,1{}\mathrm {i}-\mathrm {i}\right )\,1{}\mathrm {i}}{{\mathrm {e}}^{e\,2{}\mathrm {i}+f\,x\,2{}\mathrm {i}}+1}\right )}^n\,\left (\frac {8\,a^3\,\left (3\,A-B\,3{}\mathrm {i}+A\,n+B\,n\,1{}\mathrm {i}\right )}{f\,n\,\left (n^3\,1{}\mathrm {i}+n^2\,6{}\mathrm {i}+n\,11{}\mathrm {i}+6{}\mathrm {i}\right )}+\frac {4\,a^3\,{\mathrm {e}}^{e\,4{}\mathrm {i}+f\,x\,4{}\mathrm {i}}\,\left (n^2+5\,n+6\right )\,\left (3\,A-B\,3{}\mathrm {i}+A\,n+B\,n\,1{}\mathrm {i}\right )}{f\,n\,\left (n^3\,1{}\mathrm {i}+n^2\,6{}\mathrm {i}+n\,11{}\mathrm {i}+6{}\mathrm {i}\right )}+\frac {4\,a^3\,{\mathrm {e}}^{e\,6{}\mathrm {i}+f\,x\,6{}\mathrm {i}}\,\left (A-B\,1{}\mathrm {i}\right )\,\left (n^3+6\,n^2+11\,n+6\right )}{f\,n\,\left (n^3\,1{}\mathrm {i}+n^2\,6{}\mathrm {i}+n\,11{}\mathrm {i}+6{}\mathrm {i}\right )}+\frac {8\,a^3\,{\mathrm {e}}^{e\,2{}\mathrm {i}+f\,x\,2{}\mathrm {i}}\,\left (n+3\right )\,\left (3\,A-B\,3{}\mathrm {i}+A\,n+B\,n\,1{}\mathrm {i}\right )}{f\,n\,\left (n^3\,1{}\mathrm {i}+n^2\,6{}\mathrm {i}+n\,11{}\mathrm {i}+6{}\mathrm {i}\right )}\right )}{3\,{\mathrm {e}}^{e\,2{}\mathrm {i}+f\,x\,2{}\mathrm {i}}+3\,{\mathrm {e}}^{e\,4{}\mathrm {i}+f\,x\,4{}\mathrm {i}}+{\mathrm {e}}^{e\,6{}\mathrm {i}+f\,x\,6{}\mathrm {i}}+1} \]
-((c + (c*(exp(e*2i + f*x*2i)*1i - 1i)*1i)/(exp(e*2i + f*x*2i) + 1))^n*((8 *a^3*(3*A - B*3i + A*n + B*n*1i))/(f*n*(n*11i + n^2*6i + n^3*1i + 6i)) + ( 4*a^3*exp(e*4i + f*x*4i)*(5*n + n^2 + 6)*(3*A - B*3i + A*n + B*n*1i))/(f*n *(n*11i + n^2*6i + n^3*1i + 6i)) + (4*a^3*exp(e*6i + f*x*6i)*(A - B*1i)*(1 1*n + 6*n^2 + n^3 + 6))/(f*n*(n*11i + n^2*6i + n^3*1i + 6i)) + (8*a^3*exp( e*2i + f*x*2i)*(n + 3)*(3*A - B*3i + A*n + B*n*1i))/(f*n*(n*11i + n^2*6i + n^3*1i + 6i))))/(3*exp(e*2i + f*x*2i) + 3*exp(e*4i + f*x*4i) + exp(e*6i + f*x*6i) + 1)